from selenium.webdriver.common.by import By

from base import Base


class Page(Base):
    #XPATH定位方法
    def sousuo(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜商品名称 作者 出版社 ISBN"]')
        ele=self.find_ele(loc)
        return ele
    #CLASS_NAME定位方法
    def shuru(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele

    #ANDROID_UIAUTOMATOR定位方法
    def dianji(self):
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/tvSearch")')
        ele=self.find_ele(loc)
        return ele

    #ID定位方法
    def fanhui(self):
        loc=(By.ID,'com.kongfz.app:id/iv_back')
        ele=self.find_ele(loc)
        return ele